using AutoMapper.Configuration.Annotations;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Data;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
using XDQ.VAT.Attributes;

namespace XDQ.VAT.Students
{
    [EnableHistory]
    public class AppStudent : AuditedAggregateRoot<Guid>
        , IMultiTenant, ISoftDelete, IHasExtraProperties, IEnablable
    {

        [MaxLength(200)]
        public virtual string Name { get; protected set; }

        [Required]
        public virtual XDQ.VAT.GenderType? GenderType { get; protected set; }

        [Required]
        public virtual XDQ.VAT.Students.StudentStatusType? Status { get; protected set; }

        [Required]
        public virtual DateTime? BirthDate { get; protected set; }

        [Required]
        public virtual int? Age { get; protected set; }

        [Ignore]
        public virtual Guid? TenantId { get; protected set; }

        [Required][Ignore]
        public bool? IsDeleted { get; protected set; }

        [Required]
        public bool? IsEnabled { get; protected set; }

        [Ignore]
        bool ISoftDelete.IsDeleted { get => IsDeleted ?? false; set => IsDeleted = value; }


        protected AppStudent()
        {
        }

        public AppStudent(Guid id) : base(id)
        {
            IsDeleted = false;
            //StudentClasses = new List<AppStudentClass>();
            //StudentExamScores = new List<AppStudentExamScore>();
        }

        public AppStudent(Guid id, string name, GenderType? genderType, DateTime? birthDate, Guid? tenantId) : this(id)
        {
            Name = name ?? throw new ArgumentNullException(nameof(name));
            GenderType = genderType;
            BirthDate = birthDate;
            TenantId = tenantId;
        }


    }
}
